package com.liumingtai.learn.shiro.module.test01.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;


@TableName("blog_user")
@Data
@Accessors(chain = true)
public class BlogUser extends Model<BlogUser> implements Serializable {


    /**
     * @description
     */
    @TableId(value = "id", type = IdType.AUTO)
    private String id;

    /**
     * @description
     */
    @TableField("exhibition_id")
    private String exhibitionId;

    /**
     * @description
     */
    @TableField("user_name")
    @NotBlank
    private String userName;

    /**
     * @description
     */
    @TableField("password")
    @NotBlank
    private String password;

    /**
     * @description 盐值
     */
    @TableField("salt")

    private String salt;

    /**
     * @description
     */
    @TableField("company")

    private String company;

    /**
     * @description
     */
    @TableField("company_en")

    private String companyEn;

    /**
     * @description
     */
    @TableField("company_short")

    private String companyShort;

    /**
     * @description
     */
    @TableField("company_short_en")

    private String companyShortEn;

    /**
     * @description
     */
    @TableField("country")

    private String country;

    /**
     * @description
     */
    @TableField("province")

    private String province;

    /**
     * @description
     */
    @TableField("city")

    private String city;

    /**
     * @description
     */
    @TableField("phone")

    private String phone;

    /**
     * @description
     */
    @TableField("mobile_phone")

    private String mobilePhone;

    /**
     * @description
     */
    @TableField("email")

    private String email;

    /**
     * @description
     */
    @TableField("fax")

    private String fax;

    /**
     * @description
     */
    @TableField("creator")

    private String creator;

    /**
     * @description
     */
    @TableField("create_time")

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//返回前端字段转换

    private Date createTime;


    /**
     * @description
     */
    @TableField("mender")

    private String mender;

    /**
     * @description
     */
    @TableField("update_time")

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//返回前端字段转换

    private Date updateTime;


    /**
     * @description
     */
    @TableField("is_deleted")

    private Integer isDeleted;

    /**
     * @description
     */
    @TableField("type")

    private Integer type;

    /**
     * @description
     */
    @TableField("target_user_id")

    private String targetUserId;

    /**
     * @description
     */
    @TableField("booth_auth")

    private String boothAuth;

    /**
     * @description
     */
    @TableField("booth_area_auth")

    private String boothAreaAuth;


    //重写这个方法，return当前类的主键
    @Override
    protected Serializable pkVal() {
        return id;
    }

}